package revendication

class User {

    static constraints = {
		login(blank:false,unique:true)
		password(password:true,blank:false)
    }
	
	static mapping = {
		table 'Account'
	}
	
	boolean equals(u) {
		u.id == this.id
	}
	
	int hashCode() {
		id ?: 0
	}
	
	static hasMany = [posts : Post, likedPosts : Post, comments : Comment]
	static mappedBy = [posts : "user"]
	
	
	String login
	String password
	
}
